﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.Web.UI.Controls;
using ZX.DBModule;
using ZX.BLL.Extend;
using ZX.SYS.Library;
using ZX.CRM.Bussiness;
using ZX.BLL;

namespace ZX.WebApp.Crm.Deliver
{
    public partial class AddStudentInfo : EditUIPage
    {
        BDatPhraseDetail bllDetail = new BDatPhraseDetail();
        protected void Page_Load(object sender, EventArgs e)
        {
            string strEntity = this.GetStringFromQueryString("entity", "E_Menu");
            string ids = this.GetStringFromQueryString("id", "");
            BaseEntity instance = ZX.Common.Globals.getEntity(strEntity) as BaseEntity;
            BaseBussnies bInstance = new BLL.Extend.BaseBussnies(instance);
            BaseEntity entity = bInstance.GetEntityById(ids) as BaseEntity;
            this.EditTemplate.Text = CreateInstanceJsObject(instance, entity);
            this.MajorID.Value = this.GetStringFromQueryString("id", "");

            //房型
            IList<DatPhraseDetail> ListDetailHouseType = bllDetail.GetDatPhraseDetailByClassValue("HouseType");
            if (ListDetailHouseType != null && ListDetailHouseType.Count > 0)
            {
                this.HouseType.DataSource = ListDetailHouseType;
                this.HouseType.DataTextField = "PhraseText";
                this.HouseType.DataValueField = "PhraseID";
                this.HouseType.DataBind();
            }
            //交通方式
            IList<DatPhraseDetail> ListDetailTrafficType = bllDetail.GetDatPhraseDetailByClassValue("TrafficType");
            if (ListDetailTrafficType != null && ListDetailTrafficType.Count > 0)
            {
                this.TrafficType.DataSource = ListDetailTrafficType;
                this.TrafficType.DataTextField = "PhraseText";
                this.TrafficType.DataValueField = "PhraseID";
                this.TrafficType.DataBind();
            }
        }
    }
}